#include "Deliverables.h"
#include "CBase.h"
#include "CUnit.h"
#include "CTile.h"

SpawnUnit::SpawnUnit(int nType) : CMessage(SPAWN_UNIT)
{
	Type(nType);
}

SpawnUnit::~SpawnUnit()
{

}

DestroyUnitMessage::DestroyUnitMessage(CUnit* pUnit) : CMessage(DESTROY_UNIT)
{
	m_pUnit = pUnit;
	m_pUnit->AddRef();
}

DeleteUnitMessage::DeleteUnitMessage(CUnit* pUnit) : CMessage(DELETE_UNIT)
{
	m_pUnit = pUnit;
	m_pUnit->AddRef();
}

DamageMessage::DamageMessage(int nDmg, CUnit* pTarget) : CMessage(DAMAGE_TARGET)
{
	m_nDmg = nDmg;
	m_pTarget = pTarget;
	m_pTarget->AddRef();
}

DamageMessage::~DamageMessage()
{
	m_pTarget->Release();
}

DestroyUnitMessage::~DestroyUnitMessage()
{
	m_pUnit->Release();
}

DeleteUnitMessage::~DeleteUnitMessage()
{
	m_pUnit->Release();
}

AddLevelCollisionMessage::AddLevelCollisionMessage(int nType, int nPosX, int nPosY, int nWidth, int nHeight) : CMessage(ADD_LEVEL_COLLISION)
{
	m_nType = nType;
	m_nPosX = nPosX;
	m_nPosY = nPosY;
	m_nWidth = nWidth;
	m_nHeight = nHeight;
}

CreateTileMessage::CreateTileMessage(CTile* pDest, int nPosX, int nPosY) : CMessage(CREATE_TILE)
{
	m_nPosX = nPosX;
	m_nPosY = nPosY;
	m_pTile = pDest;
}

CreateTileMessage::~CreateTileMessage()
{
}